<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/head.css">
    <link rel="stylesheet" href="./css/font-awesome.min.css">
    <script src="./js/jquery-1.12.4.js"></script>
    <script>
        $(function(){
            
            $(".nav_ul a").mouseenter(function(){
                $(this).addClass("mouseenter")
            }).mouseleave(function(){
                $(this).removeClass("mouseenter")
            });
        });
    </script>
</head>

<body>

    <div class="nav">
        <div class="logo">
            <img src="img/logo.png" width="auto" alt="">
        </div>
        <ul class="nav_ul ">
            <a href="index.jsp">
                <li class="nav_item">首页</li>
            </a>
            <a href="#">
                <li class="nav_item">班级中心</li>
            </a>
            <a href="#">
                <li class="nav_item">点播中心</li>
            </a>
            <a href="#">
                <li class="nav_item">直播中心</li>
            </a>
            <a href="#">
                <li class="nav_item">试卷中心</li>
            </a>
            <a href="#">
                <li><i class="fa fa-ellipsis-h" aria-hidden="true"></i></li>
                
            </a>
        </ul>

        <div class="nav-right">
            <div class="search_box ">
                <form action="${pageContext.request.contextPath }/CourseServlet?method=search" method="post" id="search_form">
                    <button class="search_btn">
                        <i class="fa fa-search" aria-hidden="true"></i>
                    </button>
                    <input type="text" name="keywords" placeholder="请输入搜索内容" class="search_input">
                </form>
            </div>
        <c:if test="${loginuser==null }">
        	<div class="lr">
                <a href="login.jsp" class="go_login">登录</a>
                <a href="register.jsp" class="go_register">注册</a>
            </div>
        </c:if>
        <c:if test="${loginuser!=null }">
        	 <div class="lr">
	        	 <div>
                    <div class="userimg"><img src="./img/admin.jpg" alt=""></div>
                    <span>欢迎${loginuser}</span> 
                    <%-- <% session.removeAttribute("loginuser"); %> --%>
	             </div>
                <a href="${pageContext.request.contextPath }/UserServlet?method=myCourse&uname=${loginuser}" class="go_login">个人中心</a>
                <a href="${pageContext.request.contextPath }/UserServlet?method=logout" class="go_login">注销</a>
            </div>
        </c:if>
        </div>

    </div>
	<script src="./js/jquery-1.12.4.js"></script>
	<script>
		$(".search_btn").click(function(){
			$("#search_form").submit();
			
		})
	</script>
</body>

</html>